﻿﻿<%@ include file="/WEB-INF/controllers/configuration/includes.jsp" %>
                       
<form id="formLogin" name="f" action="j_spring_security_check" method="POST" class="formulario login">
	<input type="hidden" name="j_password" id="passwordOculto"/>
	<c:if test="${!empty param.login_error}">
		<div class="line _error">
			Username or password are incorrect
		</div>
	</c:if>    
	<c:if test="${empty param.login_error}"> 
	<div id="mensajePlacebo">			
	</div>
	</c:if> 
    <div class="groupline mlauto mrauto wpx270" >        		            
    	<div class="line">
    		<label class="icon_user" for="userlogin">  <spring:message code="label.model.user.username" /> </label>
    		<!-- <input type='text' name='j_username' value='<c:if test="${not empty param.login_error}"><c:out value="${SPRING_SECURITY_LAST_USERNAME}"/></c:if>' />-->
    		<input type='text' name='j_username' id="username"/>
    	</div>
		<div class="line">
			<label class="icon_pass" for="userpass"> 
				<spring:message code="label.model.user.password" />
			</label>
			<input type='password' id="password" ></div>
        <div class="line hpx50"><input id="botonLogin" class="baseBotton" type="button" onclick="enviar()" value="<spring:message code="label.button.acceder" />"></div>            
    </div>
</form>

<!-- No es necesario 
<spring:message code="label.text.noregistrado"></spring:message> | <a href="<c:url value="/formularioAltaInicial.do"/>"><spring:message code="label.text.solicitaalta" /></a>
 -->
<script>	
	$(document).ready(function(){
		$('#password').bind("keypress", function(e){			
			if(e.which == 13){
				$("#botonLogin").click();
			}			
		});
	});
	
	function enviar(){
		$('#passwordOculto').val(hex_sha1($('#password').val()));
		$('#formLogin').submit();
	}	
</script>